/*
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package shapet3dtest;

import javafx.application.Application;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.transform.Rotate;
import javafx.scene.transform.Scale;
import javafx.stage.Stage;

public class TextAntiAliasingTest3D extends Application {

    @Override public void start(Stage stage) {
        stage.setTitle("Path Anti-Aliasing Test");
        Scene scene = new Scene(new Group(), 800.0f, 800.0f);
        scene.setCamera(new PerspectiveCamera());
        scene.setFill(Color.BEIGE);
        Text text = new Text(-300.0F, 100.0F, "This is a test 0oO. This is a test 0oO. This is a test 0oO. This is a test 0oO.");
        text.setFill(Color.RED);
        text.setFont(new Font(40.0F));
        Text text2 = new Text(-600.0F, 300.0F, "This is a test 0oO. This is a test 0oO. This is a test 0oO. This is a test 0oO.");
        text2.getTransforms().clear();
        text2.getTransforms().addAll(new Scale(0.5F, 0.5F));
        text2.setFill(Color.RED);
        text2.setFont(new Font(80.0F));
        Text text3 = new Text(-300.0F, 500.0F, "This is a test 0oO. This is a test 0oO. This is a test 0oO. This is a test 0oO.");
        text3.getTransforms().clear();
        text3.getTransforms().addAll(new Scale(0.8F, 0.8F));
        text3.setFill(Color.RED);
        text3.setFont(new Font(60.0F));
        text3.setRotate(60.0F);
        text3.setRotationAxis(Rotate.Y_AXIS);
        ((Group)scene.getRoot()).getChildren().addAll(text, text2, text3);
        stage.setScene(scene);
        stage.sizeToScene();
        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
            System.out.println("*************************************************************");
            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
            System.out.println("*************************************************************");
        }
        stage.show();
    }

    public static void main(String[] args) {
        Application.launch(args);
    }
}
